<include file="Public:header" />
<div class="cont_main"> 
    <!---->
    <div class="uc_left">
        <include file="left_info"/>
    </div>

    <!---->
    <div class="uc_right">
        <div class="ucright_info_box">
            <h3 class="reg_tit">修改密码</h3>
            <ul class="into_info_box">
                <li><span class="ucright_ts">( 注意：请填写注册时的密保邮箱！)</span></li>
                <li><span class="reg_name_box">确认帐号：</span><span>
                        <input type="text" class="reg_inp" id='email'>
                    </span></li>
                <li><span class="reg_name_box">安全码：</span><span>
                        <input type="text" class="yzm_inp" id='captcha'>
                    </span><span class="yzm_t"><img style="cursor: pointer" onclick="this.src = 'http://www.248game.com/index.php?s=captcha&t=' + Math.random()" src="index.php?s=captcha" width="120" height="40"  alt=""/>看不清楚，换一个！</a></li>
                <li> <span class="rl_btn_warp margin_20">
                        <button class="public_img into_btn" id="sendmail">发送验证邮件</button>
                    </span> </li>
                <!--<li><p class="modify_pass_font_link"><a href="#">忘记密保？</a><a href="#">进行帐号修</a></p></li>-->
            </ul>
        </div>
    </div>
</div>
<!---->
<script type="text/javascript">
    $(function () {
        $("#sendmail").click(function () {
            var email = $("#email").val();
            var re = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
            if (!re.test(email)) {
                alert("邮箱格式不正确！");
                return false;
            }
            var captcha = $("#captcha").val();
            if (captcha === '' || captcha.length < 5) {
                alert("验证密不能为空或小于5位");
                return false;
            }
            $.ajax({
                type: 'get',
                url: domain + '/index.php?s=member/emailpass',
                data: {'email': email, "captcha": captcha},
                dataType: 'json',
                success: function (data) {
                    if (data['ret'] == 5) {
                        alert(data['msg']);
                        return;
                    } else if (data['ret'] == 7) {
                        alert(data['msg']);
                        return;
                    } else if (data['ret'] == 8) {
                        alert(data['msg']);
                        return;                        
                    } else if(data['ret'] == 10){
                        alert(data['msg'])
                        return;
                    } else if(data['ret'] == 11){
                        window.location.href = domain + '/index.php?s=member/sendsuccess'
                    }
                }
            });
        });
    });
</script>
<include file="Public:footer" />
